#ifndef __H264PPS_HPP__
#define __H264PPS_HPP__

#include "FileReader.hpp"
#include "H264SPS.hpp"

#define H264_MAX_PPS_COUNT 256



class NaluPPS: public Nalu{
public:
    NaluPPS(const Nalu & nalu);
    virtual int Parse(NaluSPS (&msps)[H264_MAX_SPS_COUNT]) override;

    uint32_t pic_parameter_set_id; //ue
    uint32_t seq_parameter_set_id; //ue
    int8_t   entropy_coding_mode_flag; //1bit
    int8_t   bottom_field_pic_order_in_frame_present_flag; //1bit
    
    uint32_t num_slice_groups_minus1; //ue
    uint32_t slice_group_map_type;
    uint32_t run_length_minus1[8];
    uint32_t top_left[8];
    uint32_t bottom_right[8];
    int8_t   slice_group_change_direction_flag;
    uint32_t slice_group_change_rate_minus1;
    uint32_t pic_size_in_map_units_minus1;
    int8_t   slice_group_id[8];

    int32_t  PicSizeInMapUnits;
    int32_t  SliceGroupChangeRate;

    uint32_t num_ref_idx_l0_default_active_minus1;  //ue
    uint32_t num_ref_idx_l1_default_active_minus1;  //ue
    uint8_t  weighted_pred_flag; //1bit
    uint8_t  weighted_bipred_idc; //2bit
    int      pic_init_qp_minus26; //se
    int      pic_init_qs_minus26; //se
    int      chroma_qp_index_offset; //se
    uint8_t  deblocking_filter_control_present_flag; //1bit
    uint8_t  constrained_intra_pred_flag; //1bit
    uint8_t  redundant_pic_cnt_present_flag; //1bit
    
    uint8_t transform_8x8_mode_flag; //u(1)
    uint8_t pic_scaling_matrix_present_flag; //u(1)
    uint8_t pic_scaling_list_present_flag[6]; //u(1)
    int32_t second_chroma_qp_index_offset; //se

    int32_t     ScalingList4x4[6][16];
    int32_t     ScalingList8x8[6][64];
    int32_t     UseDefaultScalingMatrix4x4Flag[6];
    int32_t     UseDefaultScalingMatrix8x8Flag[6];

};









#endif